
<h1><span class="yiyi-st" id="yiyi-12">numpy.fft.ifft2</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.ifft2.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.ifft2.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="function">
<dt id="numpy.fft.ifft2"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.fft.</code><code class="descname">ifft2</code><span class="sig-paren">(</span><em>a</em>, <em>s=None</em>, <em>axes=(-2</em>, <em>-1)</em>, <em>norm=None</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/fft/fftpack.py#L908-L991"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">计算二维离散傅里叶逆变换。</span></p>
<p><span class="yiyi-st" id="yiyi-15">该函数通过快速傅立叶变换（FFT）计算M维数组中任何数量的轴上的2维离散傅里叶变换的逆。</span><span class="yiyi-st" id="yiyi-16">换句话说，在数值精度内的<code class="docutils literal"><span class="pre">ifft2（fft2（a））</span> <span class="pre">==</span> <span class="pre">a</span> </code></span><span class="yiyi-st" id="yiyi-17">默认情况下，逆变换在输入数组的最后两个轴上计算。</span></p>
<p><span class="yiyi-st" id="yiyi-18">类似于<a class="reference internal" href="numpy.fft.ifft.html#numpy.fft.ifft" title="numpy.fft.ifft"><code class="xref py py-obj docutils literal"><span class="pre">ifft</span></code></a>的输入应按照与<a class="reference internal" href="numpy.fft.fft2.html#numpy.fft.fft2" title="numpy.fft.fft2"><code class="xref py py-obj docutils literal"><span class="pre">fft2</span></code></a>相同的方式进行排序，即，它应该在零阶频率项中的低阶角两个轴，在这些轴的前半部分中的正频率项，在轴的中间的奈奎斯特频率的项和在两个轴的后半部分中的负频率项，以负的负频率的次序递减。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-19">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-20"><strong>a</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-21">输入数组，可以复杂。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-22"><strong>s</strong>：ints序列，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-23">输出（<code class="docutils literal"><span class="pre">s[0]</span></code>指轴0，<code class="docutils literal"><span class="pre">s[1]</span></code>到轴1等）的形状（每个轴的长度）。</span><span class="yiyi-st" id="yiyi-24">这对于<code class="docutils literal"><span class="pre">ifft（x，</span> <span class="pre">n）</span></code>对应于<em class="xref py py-obj">n</em>。</span><span class="yiyi-st" id="yiyi-25">沿着每个轴，如果给定的形状小于输入的形状，则输入被裁剪。</span><span class="yiyi-st" id="yiyi-26">如果它较大，输入将用零填充。</span><span class="yiyi-st" id="yiyi-27">如果未给出<em class="xref py py-obj">s</em>，则使用沿<em class="xref py py-obj">轴</em>指定的轴的输入形状。</span><span class="yiyi-st" id="yiyi-28">请参阅<a class="reference internal" href="numpy.fft.ifft.html#numpy.fft.ifft" title="numpy.fft.ifft"><code class="xref py py-obj docutils literal"><span class="pre">ifft</span></code></a>零填充上的问题说明。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-29"><strong>axes</strong>：ints序列，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-30">计算FFT的轴。</span><span class="yiyi-st" id="yiyi-31">如果未给出，则使用最后两个轴。</span><span class="yiyi-st" id="yiyi-32"><em class="xref py py-obj">轴</em>中的重复索引表示该轴上的变换执行多次。</span><span class="yiyi-st" id="yiyi-33">一单元序列意味着执行一维FFT。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-34"><strong>norm</strong>：{None，“ortho”}，可选</span></p>
<blockquote>
<div><div class="versionadded">
<p><span class="yiyi-st" id="yiyi-35"><span class="versionmodified">版本1.10.0中的新功能。</span></span></p>
</div>
<p><span class="yiyi-st" id="yiyi-36">规范化模式（参见<a class="reference internal" href="../routines.fft.html#module-numpy.fft" title="numpy.fft"><code class="xref py py-obj docutils literal"><span class="pre">numpy.fft</span></code></a>）。</span><span class="yiyi-st" id="yiyi-37">默认值为None。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-38">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-39"><strong>out</strong>：complex ndarray</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-40">沿着<em class="xref py py-obj">轴</em>指示的轴变化的截断或零填充输入，如果未给出<em class="xref py py-obj">轴</em>则为最后两个轴。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-41">上升：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-42"><strong>ValueError</strong></span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-43">如果<em class="xref py py-obj">s</em>和<em class="xref py py-obj">轴</em>具有不同的长度，或<em class="xref py py-obj">轴</em>未指定，<code class="docutils literal"><span class="pre">len（s）</span> <span class="pre">！=</span> <span class="pre">2</span></code>。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-44"><strong>IndexError</strong></span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-45">如果<em class="xref py py-obj">axes</em>的元素大于<em class="xref py py-obj">a</em>的轴数。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-46">也可以看看</span></p>
<dl class="last docutils">
<dt><span class="yiyi-st" id="yiyi-47"><a class="reference internal" href="../routines.fft.html#module-numpy.fft" title="numpy.fft"><code class="xref py py-obj docutils literal"><span class="pre">numpy.fft</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-48">离散傅立叶变换的总体视图，使用定义和约定。</span></dd>
<dt><span class="yiyi-st" id="yiyi-49"><a class="reference internal" href="numpy.fft.fft2.html#numpy.fft.fft2" title="numpy.fft.fft2"><code class="xref py py-obj docutils literal"><span class="pre">fft2</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-50">前向2维FFT，其中<a class="reference internal" href="#numpy.fft.ifft2" title="numpy.fft.ifft2"><code class="xref py py-obj docutils literal"><span class="pre">ifft2</span></code></a>是反向的。</span></dd>
<dt><span class="yiyi-st" id="yiyi-51"><a class="reference internal" href="numpy.fft.ifftn.html#numpy.fft.ifftn" title="numpy.fft.ifftn"><code class="xref py py-obj docutils literal"><span class="pre">ifftn</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-52"><em>n</em>维FFT的逆。</span></dd>
<dt><span class="yiyi-st" id="yiyi-53"><a class="reference internal" href="numpy.fft.fft.html#numpy.fft.fft" title="numpy.fft.fft"><code class="xref py py-obj docutils literal"><span class="pre">fft</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-54">一维FFT。</span></dd>
<dt><span class="yiyi-st" id="yiyi-55"><a class="reference internal" href="numpy.fft.ifft.html#numpy.fft.ifft" title="numpy.fft.ifft"><code class="xref py py-obj docutils literal"><span class="pre">ifft</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-56">一维逆FFT。</span></dd>
</dl>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-57">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-58"><a class="reference internal" href="#numpy.fft.ifft2" title="numpy.fft.ifft2"><code class="xref py py-obj docutils literal"><span class="pre">ifft2</span></code></a>只是<a class="reference internal" href="numpy.fft.ifftn.html#numpy.fft.ifftn" title="numpy.fft.ifftn"><code class="xref py py-obj docutils literal"><span class="pre">ifftn</span></code></a>，且<em class="xref py py-obj">轴</em>的默认值不同。</span></p>
<p><span class="yiyi-st" id="yiyi-59">有关详细信息和绘图示例，请参见<a class="reference internal" href="numpy.fft.ifftn.html#numpy.fft.ifftn" title="numpy.fft.ifftn"><code class="xref py py-obj docutils literal"><span class="pre">ifftn</span></code></a>，对于所使用的定义和约定，请参见<a class="reference internal" href="../routines.fft.html#module-numpy.fft" title="numpy.fft"><code class="xref py py-obj docutils literal"><span class="pre">numpy.fft</span></code></a>。</span></p>
<p><span class="yiyi-st" id="yiyi-60">与<a class="reference internal" href="numpy.fft.ifft.html#numpy.fft.ifft" title="numpy.fft.ifft"><code class="xref py py-obj docutils literal"><span class="pre">ifft</span></code></a>类似，通过向指定维度的输入附加零来执行填零。</span><span class="yiyi-st" id="yiyi-61">虽然这是常见的方法，但可能会导致令人惊讶的结果。</span><span class="yiyi-st" id="yiyi-62">如果需要另一种形式的零填充，则必须在调用<a class="reference internal" href="#numpy.fft.ifft2" title="numpy.fft.ifft2"><code class="xref py py-obj docutils literal"><span class="pre">ifft2</span></code></a>之前执行。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-63">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="mi">4</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">eye</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">ifft2</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="go">array([[ 1.+0.j,  0.+0.j,  0.+0.j,  0.+0.j],</span>
<span class="go">       [ 0.+0.j,  0.+0.j,  0.+0.j,  1.+0.j],</span>
<span class="go">       [ 0.+0.j,  0.+0.j,  1.+0.j,  0.+0.j],</span>
<span class="go">       [ 0.+0.j,  1.+0.j,  0.+0.j,  0.+0.j]])</span>
</pre></div>
</div>
</dd></dl>
